#ifndef _GLOB_
#define _GLOB_
#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>


typedef int				HX_INT32;
typedef unsigned int	HX_UINT32;


#define GLIB_SYSDEF_POLLIN 1
#define GLIB_SYSDEF_POLLOUT 4
#define GLIB_SYSDEF_POLLPRI 2


//#define DEBUG(format,...) printf("[%s,%s,%d]:\033[4;32m" format "\033[0m\n",__FILE__,__FUNCTION__,__LINE__, ##__VA_ARGS__) 
#define DEBUG(format,...) printf("[%s,%s,%d]:\033[1;31m" format "\033[0m\n",__FILE__,__FUNCTION__,__LINE__, ##__VA_ARGS__) 

static int debug_flag = 0;

#define D_DEBUG(format,...) \
{ \
	if (debug_flag) \
		printf("[%s,%s,%d]:\033[1;33m" format "\033[0m\n",__FILE__,__FUNCTION__,__LINE__, ##__VA_ARGS__); \
}

#pragma pack(push) //保存对齐状态
#pragma pack(4)//设定为4字节对齐
typedef struct _st_pack_test
{
	int ap;
	char a[5];	
	char b[6];
}st_pack_test;

typedef struct _STRUCT_TEST
{
	int		a;
	int		b;
	char	c;
	char	bh[5];
	char	bj[5];
}STRUCT_TEST;
typedef struct _student
{
char name[5];
int num;
short score;
}student;

#pragma pack(pop)//恢复对齐状态

struct x_student
{
	char name[5];
	int num;
	short score;
	char version:4;
	char type:4;
	char type_1:4;
	char type_2:4;
}__attribute__ ((__packed__));


struct _struct_a
{
	char a;
	char b[0];
	char c;
}__attribute__ ((__packed__));

typedef struct _struct_a  struct_a;

struct ason_adapt_head
{
	unsigned int 	seq;/*报文序列号*/
	unsigned short	frag_seq;/*分片号*/
	unsigned short	frag_total;/*总片数*/
	char			ctrl;/*控制字*/
	char			reserve;/*备用字段*/
	unsigned short	data_len;/*数据长度*/
}__attribute__((__packed__));


#endif